home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / explist.arc / EXPLIST.DOC next >
Encoding:
Text File  |  1983-11-24  |  33.4 KB  |  984 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                         Computerenergy's Expanding Lister
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                    Version 1.0
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.                                Proprietary Notice
  45.  
  46. Expanding Lister is  a proprietary  product developed by Richard C.   Bemis and
  47. distributed by Computerenergy Corporation, Denver, Colorado.  
  48.  
  49. Copyright 1982 by Richard C.  Bemis and Computerenergy Corporation.  All rights
  50. reserved except those expressly granted to the user within this document.  
  51.  
  52. Computerenergy Corporation,  PO  Box  6267,  Denver,  CO  80206  (303) 233-9118
  53. Source: ST6070 
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                       - i -
  62.                                 TABLE OF CONTENTS
  63.  
  64. Section                                                                    Page
  65.  
  66.  
  67.  
  68. CHAPTER 1  EXPANDING LISTER DISTRIBUTION NOTICE ...........................   1
  69.  
  70. CHAPTER 2  INTRODUCTION ...................................................   2
  71.  
  72. CHAPTER 3  SYSTEM SETUP ...................................................   3
  73.    3.1  Copying Expanded Lister ...........................................   3
  74.    3.2  Program Setup - Final Installation ................................   3
  75.  
  76. CHAPTER 4  OPERATION ......................................................   4
  77.    4.1  Execution .........................................................   4
  78.    4.2  Entering Responses ................................................   4
  79.    4.3  Maillist/Donation Assistance ......................................   4
  80.    4.4  Options ...........................................................   4
  81.    4.5  Program Entry .....................................................   5
  82.  
  83. CHAPTER 5  EXPANDING LISTER FUNCTIONS .....................................   6
  84.    5.1  Blank Lines .......................................................   6
  85.    5.2  Loop Structures ...................................................   6
  86.    5.3  Multi-Statement Lines .............................................   6
  87.    5.4  Page Titles .......................................................   6
  88.    5.5  Program Title .....................................................   6
  89.    5.6  REMarks ...........................................................   6
  90.       5.6.1  Standalone Remarks ...........................................   7
  91.       5.6.2  Remarks which follow statements ..............................   7
  92.  
  93. CHAPTER 6  OPTIONS ........................................................   8
  94.    6.1  Option Setting ....................................................   8
  95.    6.2  Program Name Extension ............................................   8
  96.    6.3  Beginning Program Line Number .....................................   8
  97.    6.4  Ending Program Line Number ........................................   8
  98.    6.5  Condensed Print On/Off ............................................   8
  99.    6.6  Maximum Printer Line Length - Standard Print ......................   9
  100.    6.7  Maximum Printer Line Length - Condensed Print .....................   9
  101.    6.8  Number of Spaces to Indent per Level ..............................   9
  102.    6.9  Number of Spaces to Indent per Multple Statement ..................   9
  103.    6.10  Condensed Print ASCII Sequence ...................................   9
  104.  
  105. CHAPTER 7  PROGRAMMING SUGGESTIONS ........................................  10
  106.    7.1  Standalone REMs to segment blocks of code .........................  10
  107.    7.2  Routine Management ................................................  10
  108.       7.2.1  Remarks after GOSUB statements to describe routines ..........  10
  109.       7.2.2  GOSUB Library ................................................  10
  110.    7.3  FOR ... NEXT Case structure .......................................  11
  111.    7.4  Other Coding Recommendations for Lister Limitations ...............  11
  112.  
  113. CHAPTER 8  OTHER INFORMATION ..............................................  13
  114.    8.1  Distribution Disk Contents ........................................  13
  115.    8.2  System Requirements ...............................................  13
  116.    8.3  Disclaimer ........................................................  13
  117.  
  118. CHAPTER 9  SUGGESTIONS, FEEDBACK, AND BUG REPORTS .........................  14
  119.  
  120.  
  121. Expanding Lister                     - ii -          Computerenergy Corporation
  122.                                     CHAPTER 1
  123.  
  124.                       EXPANDING LISTER DISTRIBUTION NOTICE
  125.  
  126. Expanding Lister is being distributed using the "Freeware"* approach.  To those
  127. of you  unfamiliar with this approach, it works like this.  You may send either
  128. a preformatted  single-sided disk  (or a prepaid contribution for  our disk and
  129. mailer) to  us with a prepaid return mailer and we will send a complete copy of
  130. the product.   If the product does not meet your needs, please pay nothing.  If
  131. the product  does meet your needs, and you can use it, then we would appreciate
  132. a  contribution of  whatever  you  feel  is  appropriate.  Naturally,  we  have
  133. probably given  you  a clue  in several  places  as to what is  our "completely
  134. unprejudiced opinion" of an appropriate contribution amount.  Contributions are
  135. completely voluntary and much encouraged.  
  136.  
  137. Even if you  do not  contribute, you are encouraged to  copy and distribute the
  138. product freely subject to the following restrictions: 
  139.  
  140.      1. Do not  distribute altered copies.  Note: You may distribute a separate
  141.         set of modifications  to merge in if you  wish but they must be clearly
  142.         identified  as  not originating  from Computerenergy.   If  you do make
  143.         modifications, we  would like to see what you've done, if possible, for
  144.         future versions.  
  145.  
  146.      2. The  product  is to  be distributed  as  a complete "distribution copy"
  147.         produced  by the  copy  utility  provided  with  the product  for  this
  148.         purpose.  
  149.  
  150.      3. No fee is to be charged for copying or distributing the program without
  151.         an express written agreement with Computerenergy Corporation.  
  152.  
  153.      4. Commercial  sale of  this product  in any manner is prohibited  without
  154.         Computerenergy's  written  permission.  Some  products will be released
  155.         with this permission automatically given and expressly stated.  
  156.  
  157. User Groups/Clubs:  Computerenergy's  freeware  products may  be distributed by
  158. Clubs and User Groups subject to the same restrictions.  We would ask only that
  159. contributions to  our continuing efforts be encouraged by those performing such
  160. distribution.  
  161.  
  162. Computer Bulletin Boards: Computerenergy's freeware products may be distributed
  163. by  BBS's  subject  to the  same restrictions  and  contribution encouragement.
  164. However, as the products tend to be large and consist of several files, we have
  165. some concern as to the reliability of transmissions and length of connect time.
  166. Perhaps disks could be mailed or just the documentation placed on the board for
  167. browsers.  
  168.  
  169.  
  170. * The  Freeware concept  was initially  developed by Andrew Fluegelman and  the
  171. term  "FREEWARE"  is a  trademark of  The Headlands Press, Inc.  The  Headlands
  172. Press provides  a catalog of information about Freeware products available from
  173. multiple sources.   They may  be contacted at PO Box  862, Tiburon, CA 94920 or
  174. Source: TCP204 or Compuserve: 71435,1235.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181. Expanding Lister                     - 1 -           Computerenergy Corporation
  182.                                     CHAPTER 2
  183.  
  184.                                   INTRODUCTION
  185.  
  186.  
  187. Computerenergy's Expanding   Lister   was  created   to  make  programming  and
  188. maintenance jobs  easier.   We  feel  that  a computer  should  help as much as
  189. possible in its  own development efforts.  The Expanding  Lister is a tool that
  190. performs a  number of formatting functions as a program is listed.  It provides
  191. powerful aids to visualizing what is happening (and where) within a program.  
  192.  
  193. Expanding Lister will  do several things to help you improve the readability of
  194. your  program  listings.   Most of  its functions  are  designed to display the
  195. structure  of a  program without  the burden of any additional  effort from the
  196. programmer.   However,  as  you become  more familiar  with  Expanding Lister's
  197. capabilities, you may  wish to slightly adjust the  way you enter code in order
  198. to take greater advantage of some of the features.  
  199.  
  200. After you have  setup the  system and read the Operation  chapter, we recommend
  201. that you try the Lister on some of your own programs.  
  202.  
  203. If you  are  going to  "wing-it" without  reading further, then SAVE the  Basic
  204. program to be listed in ASCII (true wingers understand this), type EXPLIST, and
  205. good luck!  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. Expanding Lister                     - 2 -           Computerenergy Corporation
  242.                                     CHAPTER 3
  243.  
  244.                                   SYSTEM SETUP
  245.  
  246.  
  247. The Expanding Lister  distribution disk contains two versions of the program in
  248. compiled  formats  along with  its options  file.   Compiled versions are being
  249. distributed  as  they  execute much  faster.  The  first  is EXPLIST.EXE and is
  250. compiled in  complete native format.  It is the fastest version, but requires a
  251. larger amount of  disk space.  The second is  EXPLISTR.EXE which is smaller but
  252. requires  the Basic  Compiler Run-Time  package which is not included  as it is
  253. available only under license from IBM at $30/copy.  EXPLISTR is slightly slower
  254. than EXPLIST and the speed difference is not noticable unless a large number of
  255. statements are skipped over before listing begins.  
  256.  
  257. 3.1  Copying Expanded Lister
  258.  
  259.      There is a batch file which copies the entire distribution disk for backup
  260.      or distribution purposes.  We highly recommend making a backup copy before
  261.      proceeding as it is safer and the mails can be slow.  
  262.  
  263.      Place the Expanding Lister  distribution disk in Drive A:  and a formatted
  264.      disk without DOS on it in Drive B:.  While in DOS, type EXPCOPY and follow
  265.      any instructions.  
  266.  
  267. 3.2  Program Setup - Final Installation
  268.  
  269.      We recommend that  a copy  of the Lister and its  control file, EXPOPT, be
  270.      placed  on a  Basic Program  Development DOS System disk if  possible.  If
  271.      this is  your first  run-through, do not perform this  step yet - use your
  272.      copy of the distribution disk and proceed to the Operation Chapter.  
  273.  
  274.      1. Copy the EXPLIST.EXE (or the EXPLISTR.EXE program if you have the Basic
  275.         Run Time Module) to the System disk.  
  276.  
  277.              A Sample COPY command might be:
  278.  
  279.                             COPY B:EXPLIST.EXE A:
  280.  
  281.      2. Copy the EXPOPT file to the same disk.  This file must be available any
  282.         time the EXPLIST(R) program is used.  
  283.  
  284.              A sample COPY command might be:
  285.  
  286.                             COPY B:EXPOPT A:
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301. Expanding Lister                     - 3 -           Computerenergy Corporation
  302.                                     CHAPTER 4
  303.  
  304.                                     OPERATION
  305.  
  306. 4.1  Execution
  307.  
  308.      Starting the  Expanding  Lister  is simply  a matter  of  entering DOS and
  309.      typing EXPLIST (or EXPLISTR) followed by the Enter key.  
  310.  
  311. 4.2  Entering Responses
  312.  
  313.      You will quickly notice that all input requested by Expanding Lister is at
  314.      the  bottom  of  the screen,  following a  prompt,  and contained within a
  315.      "target".  We have found that a relatively constant area for data entry is
  316.      superior  to  the  more  typical  design  of  "fill-in-the-blanks"  as  it
  317.      minimizes  eye travel  and  usually  makes  for  a more  consistant  entry
  318.      process.   All  responses  are completed  by pressing  the  Enter key.  In
  319.      several prompts,  and on  the keyboard, the Enter key  is represented by a
  320.      symbol roughly similar to this: (<-').  
  321.  
  322.      In addition  to  the  normal  editing  functions provided  for inner-field
  323.      editing there are a couple of special functions available: 
  324.  
  325.                Field Erase:  Press the ESC key to erase an entry and start over
  326.                              or to change a field that has a pre-loaded value.
  327.  
  328.                Field Backup: Press the Up-Arrow to "backup" to the previous
  329.                              entry.  The current entry will be erased as you
  330.                              "backup".
  331.                              Note: You can "backup" as far as you like until
  332.                              the very beginning of the program.
  333.  
  334. 4.3  Maillist/Donation Assistance
  335.  
  336.      The first  screen you  see is  a title, information, and copyright  screen
  337.      with a "Press Enter to continue or space for Maillist/Donation assistance"
  338.      prompt.  Normally, you  will press the Enter key  to start the Lister.  If
  339.      you press  the space  bar, a program will run  which will help you print a
  340.      letter that you can send to us to be sure you are placed on our maillist -
  341.      particularly important  if you did not receive your copy directly from us.
  342.      Amazingly enough, the letter will even assist you in making a contribution
  343.      but that is not required (nice though).  
  344.  
  345.      Note: The assistance  program - EXPMAIL - is contained on the distribution
  346.      disk and  its copies but should not be copied to your DOS development disk
  347.      as it  is  large, not  required, and  a  waste of disk space.   EXPMAIL is
  348.      chained from the Expanded Lister as it resides on the distribution disk or
  349.      may be executed directly from the distribution disk by typing EXPMAIL.  If
  350.      you are using EXPLISTR, EXPMAIL must be executed standalone.  
  351.  
  352. 4.4  Options
  353.  
  354.      There are a  number of options which may be changed as desired by the user
  355.      in  order  to  tailor the  Lister to  his  configuration.  The options are
  356.      usually changed only  for the current run but  may be permanently saved if
  357.      desired.  As  the program is initially distributed, all options are set at
  358.      the  most  commonly used  values.  We  would recommend that no options  be
  359.      changed until you are more familiar with the Lister's functions.  
  360.  
  361. Expanding Lister                     - 4 -           Computerenergy Corporation
  362.                                                            CHAPTER 4: OPERATION
  363.  
  364.  
  365. 4.5  Program Entry
  366.  
  367.      Up to 25 programs  may be specified to be  listed in sequence at one time.
  368.      NOTE: Each program must be previously saved in ASCII format using the ",A"
  369.      option of the Save command in Basic.  Example: 
  370.  
  371.                     SAVE "B:progname.S",A
  372.  
  373.      We use the  .S  extension  for  "Source"  to differentiate  between  Basic
  374.      encoded programs  and those saved in ASCII.  This approach also provides 2
  375.      copies of  each program  as it is developed -  a sort of automatic backup.
  376.      Any program extension may be used.  
  377.  
  378.      If a program is read by the Lister that has accidentally not been saved in
  379.      ASCII, the Lister will display an ERR=62 message and return to DOS.  
  380.  
  381.      For each program to be listed, the Lister asks for 3 pieces of information
  382.      - program name, beginning line number to start listing, ending line number
  383.      to end listing.  Each program name may be entered without an extension and
  384.      the Lister  will append the Program Name Extension specified in the option
  385.      list.   If  the  program is  entered with  an  extension, then the entered
  386.      extension will be used.  
  387.  
  388.      Each line  number field  is pre-loaded  with a default value which  may be
  389.      changed  most easily  by pressing  the ESC key and keying  a new number or
  390.      backspacing and  re-keying the  number.  The default value is  selected by
  391.      pressing the Enter key.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421. Expanding Lister                     - 5 -           Computerenergy Corporation
  422.                                     CHAPTER 5
  423.  
  424.                            EXPANDING LISTER FUNCTIONS
  425.  
  426. 5.1  Blank Lines
  427.  
  428.      A blank link  is  inserted  after  certain  Basic keywords  such  as GOTO,
  429.      RETURN,  NEXT,  etc.  This  helps break  up the code visually at  probable
  430.      control transfer or routine ending points.  
  431.  
  432.      A blank link is also inserted before each FOR and WHILE.  
  433.  
  434.  
  435. 5.2  Loop Structures
  436.  
  437.      Each statement within  a FOR ...  NEXT or WHILE ...  WEND loop is indented
  438.      to indicate  that  it  is  in  control.  Nested  loops  are indicated with
  439.      further  indentations.   The  indentations provide  a simple but effective
  440.      visible structure to the program.  
  441.  
  442.  
  443. 5.3  Multi-Statement Lines
  444.  
  445.      In program  lines  that  contain  multiple  statements, each  statement is
  446.      placed on a  separate line.  Statements 2 through  N are indented 2 spaces
  447.      and preceeded by  colons.  This greatly enhances ledgibility  and provides
  448.      much more space to make any necessary changes.  
  449.  
  450.  
  451. 5.4  Page Titles
  452.  
  453.      Each page  of the  program listing  is titled, dated, and time  stamped as
  454.      well as paginated.  
  455.  
  456.  
  457. 5.5  Program Title
  458.  
  459.      A banner title is  printed at the beginning of  each program listing.  The
  460.      title contains the name of the program being listed.  In addition, if line
  461.      15 in a program is of the form: 
  462.  
  463.                15 ZTITLE$="Official Program Description/Title"
  464.  
  465.      then that  description  will  also be  included in  the  banner title as a
  466.      separate line.   The  line  15  feature  maintains compatability  with  an
  467.      upcoming product and is totally optional.  
  468.  
  469.  
  470. 5.6  REMarks
  471.  
  472.      Remark statements are used within a program to provide documentation about
  473.      sections  of  the  code.   Many  programmers  provide  extra  highlighting
  474.      statements around their  remarks to have them stand  out within a listing.
  475.      We felt that the computer should automatically provide the highlighting.  
  476.  
  477.      For the purposes  of the Lister, there are two types of remark statements.
  478.      The  first  is a  remark  on  its  own  statement number  which  we call a
  479.      Standalone Remark.  The  other is a remark which  follows a statement or a
  480.  
  481. Expanding Lister                     - 6 -           Computerenergy Corporation
  482.                                           CHAPTER 5: EXPANDING LISTER FUNCTIONS
  483.  
  484.  
  485.      series of statements on a line.  Each has a separate type of highlighting.
  486.  
  487.  
  488. 5.6.1  Standalone Remarks
  489.  
  490.      Remarks which are  placed on  a separate line are printed  and highlighted
  491.      with a  blank  line,  a  full  line of  asterisks,  the remark - centered,
  492.      another full  line of  asterisks, and another blank line.   The remark may
  493.      begin  with either  REM or  the single quote abbreviation.  If  there is a
  494.      series of remarks, they will be included within a single highlight.  
  495.  
  496.  
  497. 5.6.2  Remarks which follow statements
  498.  
  499.      Remarks which follow  statements are  treated in one of two  ways.  If the
  500.      remark uses the  single quote, then the remark  will be right-justified on
  501.      the line  containing the last statement.  If the remark is a REM statement
  502.      as the last  statement on the line following  one or more statements, then
  503.      no highlighting will occur.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541. Expanding Lister                     - 7 -           Computerenergy Corporation
  542.                                     CHAPTER 6
  543.  
  544.                                      OPTIONS
  545.  
  546. 6.1  Option Setting
  547.  
  548.      As the Expanding  Lister begins its execution, it will display the current
  549.      setting of all  of its options and ask  if you wish to change any of them.
  550.      Any  changes  that are  made will  be effective for the current  run only.
  551.      However, after the  changes are made, the Lister  asks if you wish to make
  552.      them permanent.   If you respond "Y" then the current settings will become
  553.      the automatic option  values from then on.  Of  course, you may change any
  554.      option on any  run and then make the  new settings permanent as many times
  555.      as you desire.  
  556.  
  557.  
  558. 6.2  Program Name Extension
  559.  
  560.      The Program Name Extension option is used by the Lister to concatenante to
  561.      any  program  name that  is entered  without an extension.  We use  .S for
  562.      "Source"  to  differentiate from  Basic encoded programs extensions (.BAS)
  563.      but any extension is acceptable.  
  564.  
  565.      If a program name is entered with an extension, this option is ignored.  
  566.  
  567.  
  568. 6.3  Beginning Program Line Number
  569.  
  570.      The beginning program  line number option establishes a value that will be
  571.      preloaded into the  Beginning Line Number prompt request  for each program
  572.      to  be  listed.  The  value may  be changed at entry time  for any and all
  573.      programs, if desired.  
  574.  
  575.      We tend to place  a significant number of commonly  used routines at lines
  576.      10 -  9999 and therefore do not wish to list these routines over and over.
  577.      The  beginning  value  we use  is  10000  but  any  valid line  number  is
  578.      acceptable.  
  579.  
  580.  
  581. 6.4  Ending Program Line Number
  582.  
  583.      The ending  program line  number option  establishes a value that will  be
  584.      preloaded into the  Ending Line Number prompt request  for each program to
  585.      be  listed.  The  value  may  be  changed  at entry  time  for any and all
  586.      programs, if desired.  
  587.  
  588.      The value we  use is  65529, which is the highest  valid line number for a
  589.      Basic  program  and therefore  will list  to the end of the  program.  Any
  590.      valid line number is acceptable.  
  591.  
  592.  
  593. 6.5  Condensed Print On/Off
  594.  
  595.      The Condensed Print On/Off  option is a "toggle" option.   When you select
  596.      it, it  will reverse status from ON to OFF or OFF to ON.  This option will
  597.      generate condensed or compressed print on Epson printers and thereby allow
  598.      more levels  of indentation than would be otherwise available.  Titles and
  599.      Remark highlighting are adjusted for condensed print.  
  600.  
  601. Expanding Lister                     - 8 -           Computerenergy Corporation
  602.                                                              CHAPTER 6: OPTIONS
  603.  
  604.  
  605.      The option is effective for all programs listed during the current run.  
  606.  
  607.  
  608. 6.6  Maximum Printer Line Length - Standard Print
  609.  
  610.      For standard (ie.   not condensed) print, this option contains the maximum
  611.      print line  length available.  This value is used by the Lister in a Width
  612.      statement.  
  613.  
  614.  
  615. 6.7  Maximum Printer Line Length - Condensed Print
  616.  
  617.      For condensed print,  this option  contains the maximum print line  length
  618.      available.  This value is used by the Lister in a Width statement.  
  619.  
  620.  
  621. 6.8  Number of Spaces to Indent per Level
  622.  
  623.      The number of spaces  to indent per level option  contains the incremental
  624.      "tab  value"  of spaces  that  is  used  for  each loop  control  level of
  625.      indentation.  This  value is added to the indentation as each FOR or WHILE
  626.      loop is encountered  and subtracted from the indentation  for each NEXT or
  627.      WEND.  
  628.  
  629.      We recommend a  number of around 5 unless there is deep nesting of program
  630.      loop levels.  
  631.  
  632.  
  633. 6.9  Number of Spaces to Indent per Multple Statement
  634.  
  635.      The number of  spaces to  indent per multiple statement is  the additional
  636.      amount  of  indentation to  be added  to the current level for  the second
  637.      through the last statement on a line as the statements are printed.  
  638.  
  639.      We recommend the standard value of 3 be maintained, if possible.  
  640.  
  641.  
  642. 6.10  Condensed Print ASCII Sequence
  643.  
  644.      The condensed print  ASCII sequence is a series of up to 5 3-digit decimal
  645.      ASCII codes.   These codes  will be sent to your  printer if the condensed
  646.      print option is  "ON".  Each code must contain  3 digits which may include
  647.      leading zeroes if  necessary.  No embedded blanks or  other separators are
  648.      allowed.  Enter as many codes as needed.  
  649.  
  650.      As distributed, this code contains the sequence for IBM/Epson printers.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661. Expanding Lister                     - 9 -           Computerenergy Corporation
  662.                                     CHAPTER 7
  663.  
  664.                              PROGRAMMING SUGGESTIONS
  665.  
  666. 7.1  Standalone REMs to segment blocks of code
  667.  
  668.      In order  to   visually  segment  your  routines,  we  suggest  that  each
  669.      subroutine be  titled with one (or more) standalone Remarks.  Depending on
  670.      your  style, you  may also  wish to group your subroutines  in one area of
  671.      your program.  With the Expanding Lister, it becomes much easier to locate
  672.      routines.  
  673.  
  674.      There is an  ongoing debate about whether it is good practice to branch to
  675.      Remark  statements.   If you  do,  it  is  easier  to insert  code  at the
  676.      beginning  of  the routine.   However, some compression programs eliminate
  677.      Remark  statements entirely  thus creating invalid line number references.
  678.      The Basic  Compiler must also save some space for the REM statement if you
  679.      branch to it.   Our feeling is that it  is better not to branch to Remarks
  680.      if possible.  
  681.  
  682.  
  683. 7.2  Routine Management
  684.  
  685. 7.2.1  Remarks after GOSUB statements to describe routines
  686.  
  687.      One of the more difficult aspects of using IBM's Basic for larger programs
  688.      is  that  routines  are identified  solely with  line  numbers rather than
  689.      labels or  names.  That's  not all bad until you  renumber the program and
  690.      the numbers all change.  
  691.  
  692.      To assist your debugging  and make your program more  readable, we suggest
  693.      placing a  remark  on  the  line  with each  significant  GOSUB statement.
  694.      Example: 
  695.  
  696.                12100  GOSUB 22000  'Read Input
  697.  
  698.      Now, no matter  what 22000 is renumbered to, the comment will identify the
  699.      routine.  The Expanding  Lister will move these remarks  over to the right
  700.      side of  the page for easier reading.  Note: this can only be done for the
  701.      last statement  on a multiple statement line as everything following the "
  702.      ' " sign will be ignored.  
  703.  
  704.  
  705. 7.2.2  GOSUB Library
  706.  
  707.      Also for larger programs, we suggest placing a routine or GOSUB library at
  708.      the end  of your program to help identify routine locations and functions.
  709.      The form might be: 
  710.  
  711.                60000 REM Routine Library
  712.                60010 GOSUB 22000  REM Read Input
  713.                60020 GOSUB 11130  REM Process Calculations
  714.                60030 GOSUB 32312  REM Output Line
  715.                 etc. - 1 per statement
  716.  
  717.      This code is  never executed,  but will automatically show the  effects of
  718.      any renumbering.   After renumbering,  if you wish to GOSUB  to a routine,
  719.      you can  easily determine  its new line number from  this list rather than
  720.  
  721. Expanding Lister                     - 10 -          Computerenergy Corporation
  722.                                              CHAPTER 7: PROGRAMMING SUGGESTIONS
  723.  
  724.  
  725.      searching through pages of code.  
  726.  
  727.      Note: the  use  of GOSUBs  in the  library is recommended rather than  the
  728.      shorter GOTO  as the Expanding Lister will insert a blank line after every
  729.      GOTO and  the library will not be as compact.  The word REM instead of the
  730.      shorter " ' " is used as otherwise the Remark will be shifted to the right
  731.      of the page and be more difficult to read.  
  732.  
  733.  
  734. 7.3  FOR ... NEXT Case structure
  735.  
  736.      Dr. Willard A.  Brown writes about a nifty method of adding some structure
  737.      to  Basic  programs in  the September  issue of Personal Computer Age  (p.
  738.      51-52  Vol 1.6  -  not  a  bad  magazine, by  the  way).  Essentially, his
  739.      recommendation  is  an implementation  of SELECT  ...   CASE using FOR ...
  740.      NEXT.  We've  tried it,  it works and when combined  with loop indentation
  741.      provides a good visual structure.  Our variation (changes DO to CASEn%) of
  742.      his recommendation: 
  743.  
  744.                FOR CASE1% (truth statement) TO -1
  745.                     statement
  746.                     statement
  747.                     NEXT CASE1%
  748.  
  749.      Quoting from Dr.  Brown: "First a few words about truth statements for the
  750.      beginners among you.   In IBM BASIC, a true  statement takes on a value of
  751.      -1, while false statements are indicated with a 0." 
  752.  
  753.      "Here are a couple of simple examples of truth statements: 
  754.  
  755.                (Age>25) = -1 
  756.  
  757.                if age is 30.  If age age is 24, 
  758.  
  759.                (Age>25) = 0 
  760.  
  761.      "The FOR-NEXT construct  executes until the index counter (CASE1%, in this
  762.      case) is greater  than the final value.  If  the truth statement is false,
  763.      its already greater than the final value, and so the code section won't be
  764.      executed.  If  the  truth  statement  is  true, the  code  section will be
  765.      executed once.  For  more information on this, see  pages 3-22 and 4-88 in
  766.      the BASIC manual.  For nested blocks of statements, be sure to use CASE2 ,
  767.      CASE3 , etc.  to eliminate ambiguity." 
  768.  
  769.      That is the heart  of his suggestion, but you  might want to read the full
  770.      article.   Be  aware that  although maintainability is improved, execution
  771.      speed may slow, especially with the interpreter - the usual quality versus
  772.      speed tradeoff.  (Yes, we used it in the Lister.) 
  773.  
  774. 7.4  Other Coding Recommendations for Lister Limitations
  775.  
  776.      1. Keep REMark statements to under 65 characters unless condensed print is
  777.         being  used.   If you  need more  room, use another remark on  the next
  778.         line.  
  779.  
  780.  
  781. Expanding Lister                     - 11 -          Computerenergy Corporation
  782.                                              CHAPTER 7: PROGRAMMING SUGGESTIONS
  783.  
  784.  
  785.      2. Always use  correct and  complete syntax.  Ex.  Do not  use PRINT "text
  786.         (c/r) without a final quotation mark even though it works.  
  787.  
  788.      3. Use  only  a  single  NEXT per  FOR  or  a  single  WEND per  WHILE  as
  789.         indentation  results  will  be incorrect.   The Basic Compiler requires
  790.         this approach.  
  791.  
  792.      4. Try not to  use capital FOR, NEXT, WHILE,  WEND surrounded by blanks in
  793.         literals as they will be treated as keywords.  
  794.  
  795.         We will  continue  to work  to remove  as many of these limitations  as
  796.         possible.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841. Expanding Lister                     - 12 -          Computerenergy Corporation
  842.                                     CHAPTER 8
  843.  
  844.                                 OTHER INFORMATION
  845.  
  846. 8.1  Distribution Disk Contents
  847.  
  848.  
  849.           File Name       Description
  850.           ------------    --------------------------------------
  851.  
  852.           EXPLIST.EXE     Fully compiled Lister
  853.           EXPLISTR.EXE    Compiled for Compiler's Run Time Module
  854.           EXPLIST.DOC     Documentation
  855.           EXPOPT          Options File
  856.           EXPMAIL.EXE     Maillist/Donation Assistance
  857.           EXPCOPY.BAT     Copies Distribution Disk
  858.  
  859.  
  860. 8.2  System Requirements
  861.  
  862.      Expanding Lister requires an IBM PC with 64K, DOS 1.1, and at least 1 disk
  863.      drive (2 disks highly recommended for development machines).  
  864.  
  865.  
  866. 8.3  Disclaimer
  867.  
  868.      All Computerenergy computer programs  are distributed on an "as  is" basis
  869.      without warranty.  
  870.  
  871.      Computerenergy Corporation and/or any of its program authors shall have no
  872.      liability or responsibility to customer or any other person or entity with
  873.      respect to  any liability,  loss or damage caused or  alleged to be caused
  874.      directly  or  indirectly   by  programs  distributed  in  any   manner  by
  875.      Computerenergy Corporation,  including but not limited to any interruption
  876.      of  service,  loss of  business or  anticipatory  profits or consequential
  877.      damages resulting from the use or operation of such computer programs.  
  878.  
  879.      Note: Good  data  processing  procedure dictates  that the  user  test the
  880.      program, run  and test sample sets of data, and run the system in parallel
  881.      with the  system previously in use for a period of time adequate to insure
  882.      that results of operation of the computer program are satisfactory.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901. Expanding Lister                     - 13 -          Computerenergy Corporation
  902.                                     CHAPTER 9
  903.  
  904.                      SUGGESTIONS, FEEDBACK, AND BUG REPORTS
  905.  
  906.      If you  can  spare  the  time,  we  would  appreciate  your  feedback  and
  907.      suggestions to  help us to improve the Lister.  As an added inducement, we
  908.      will  also send  a free  Lister (corrected) to the first  person reporting
  909.      each bug.   Immediate family  members of Computerenergy employees are  NOT
  910.      eligible.  Valid bugs do not include obvious architectual limitations such
  911.      as 52 indentation levels falling off the page, etc.  If possible, each bug
  912.      reported  should include  a short-as-possible  printout  of the before and
  913.      after  expansion  situation  with  explanatory  notes.   Our  unprejudiced
  914.      judging panel  will make  "Bug Awards" when the spirit  moves them and, of
  915.      course, their decisions are final.  
  916.  
  917.      We are also  aware of  some esthetic errors when operating  with the color
  918.      video interface.  Those still remaining should be corrected soon, but we'd
  919.      still like to hear about any you find.  
  920.  
  921.      Please address  correspondence  to  the address  on the  title  page.  (If
  922.      you've lost  your title page, just send us a note and we'll send you a new
  923.      one.) 
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961. Expanding Lister                     - 14 -          Computerenergy Corporation
  962. 
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984. Expanding Lister